home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
C/C++ Interactive Reference Guide
/
C-C++ Interactive Reference Guide.iso
/
c_ref
/
csource5
/
344_01
/
pb.doc
< prev
next >
Wrap
Text File
|
1989-10-29
|
1KB
|
44 lines
/*
* HEADER: ;
* TITLE: PB Phone Book Manual Page;
* DATE: 10/27/1989;
* VERSION: 1.0;
* FILENAME: PB.DOC;
* SEE-ALSO: PB.C, STRISTR.C, BLKSPLIT.C;
* AUTHORS: Michael Kelly;
*/
'Quick and Dirty Phone Directory'
DESCRIPTION:
This example program implements a telephone directory to illustrate
the use of the blksplit() and stristr() functions on this disk.
It loads a file of ASCII data, ( "phonebk.dat" ) splitting it into lines
( using blksplit() ) and performing a case insensitive search
( using stristr() ) for the requested substring.
It then echos matching records and a total of records matched.
The size of the data file is limited to the largest memory block
minus 1 that can be allocated with calloc(), the substring is
limited to 127 characters, and records are limited to one line
of ASCII text.
The blksplit() function can just as easily be used to split a
line of text into fields.
INVOCATION:
PB [ searchstring ]